Repository navigation
fix(libkernel): query non-readable live mappings - #1929
Conversation
|
The PR is based on current upstream |
493000d to
6e5bb47
Compare
|
#1929 now stacks on the exact current #1731 commit |
klosixgaming-arch
left a comment
There was a problem hiding this comment.
Good fix for a real bug: after a partial munmap, sceKernelVirtualQuery was reporting the full allocation range instead of the live sub-range. The new logic coalesces contiguous sub-ranges (same allocationAddress, adjacent addresses) in both directions, so a query inside a fragmented allocation reports the correct live extent and a query in the unmapped hole returns EACCES. The test CheckVirtualQueryAfterPartialUnmap covers the merged range, the hole, the findNext flag, and the post-unmap state — exactly the regression this fixes.
Minor: the bidirectional merge walks the lease and assumes it is ordered by address; if that invariant is ever relaxed, the coalescing would silently under-merge. An assert (or a one-line note) that the lease is address-ordered would make the assumption explicit.
Written with AI assistance.
6e5bb47 to
9f25043
Compare
|
The lease is address-ordered by construction: the registry stores ranges in |
|
@klosixgaming-arch #1929 now stacks on the exact current #1731 commit and its source tree is unchanged from the fully green fork Build 37868880231. Linux CTest 497/497, Windows CTest 488/488, and all relinker jobs passed. Exact-head Build 37870858453 is running; please re-review the current head after it completes. |
9f25043 to
6db0682
Compare
6db0682 to
ee68f67
Compare
|
The exact current heads are |
a0b5c1e to
4ff734c
Compare
|
Updated head: rebased the #1731 shared patch plus this follow-up onto current upstream main 25f1008; pushed |
4ff734c to
8a222b6
Compare
|
Rebased the fully reviewed three-commit diff onto current upstream |
|
Build 37904356054 completed: Linux and Windows fail only while compiling |
8a222b6 to
103e97f
Compare
|
Updated to current upstream |
|
@klosixgaming-arch Your review observation about address ordering is now explicit in this head via the |
8134a0e to
099b8cf
Compare
|
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
AI-assisted: yes |
|
Thanks for the Windows report. It tests the exact PR commit |
099b8cf to
83983e3
Compare
|
Rebased the existing PR linearly onto current |
83983e3 to
14d150b
Compare
Updated head and validationI rebased the existing branch linearly onto upstream Could the reviewer recheck the assertion on this current head, and could a collaborator with write access run Actions → Build for PR #1929? The required upstream Linux/Windows and relinker matrix has not run for this head. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
The overlap scan flagged #2267. I reviewed both diffs: the |
Use the current registered range after protection splits and partial unmaps, including FIND_NEXT lookups. Add a regression covering extents, protection and surviving contents. AI-assisted: yes
Carry over the direct mmap regression from PR boykopovar#2267. The live-extent implementation is already present in the preceding commits.
14d150b to
e06c459
Compare
|
I rebased the existing branch onto current |
|
The latest overlap scan also flags #1324 and #1360 in
I found no duplicate behavior or dependency between these changes. The additions can coexist; the overlap is at the header/implementation files and may need a small insertion-hunk resolution when branches are combined. The separate direct- |
…rtial-unmap fix(libkernel): query non-readable live mappings
Closes #1894.
What
This PR carries the live-mapping extent fix from #1731 (the original commit author is preserved), adds support for querying live ranges whose registry protection is
PROT_NONE, and includes the direct-mmappartial-unmap regression test contributed in #2267. The test commit retains Saranxzi as its author.sceKernelVirtualQuerymust report current mapped extents after partial unmaps and still find non-readable mappings; GPU consumers continue using the existing readable-only lease.Without the full-range snapshot,
guest_ampr_markersfails when querying AMPR protection on a mapped range. The regression checks aPROT_NONEmapping and verifies the registered extent and protection. A debug assertion makes explicit that the full-range lease is address-ordered before the coalescing scan relies on that invariant.Tested
Current head
e06c459534fec70b5738d55392794fa963421024is rebased linearly onto upstreammainate51d4e1f21280da4529dc7fe3a3d50d7d7dbc3ec. The complete source diff remains limited to four files.guest_memory_tests;guest_memorypassed (1/1) on this head, exercising flexible-range splits,PROT_NONE, and directmmapafter partial unmap.guest_memorypassed and full CTest passed (510/510) on pre-rebase commit099b8cf0cherry-picked ontomaind70b8998(report); this predates the additional direct-mmaptest. Saranxzi separately reported the direct-mmapregression passing on Windows and Linux on fix(libkernel): report live mapping bounds in sceKernelVirtualQuery after partial unmap #2267 head8073bda, not on this combined head.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpass.agc_shader_fusion_tests; fix(tests): add SPIRV-Headers to the tests that include VulkanTestDevice.hpp #2099 fixed that dependency. Eligibility, Conventions, report, and all three relinker jobs pass on this head. The automated PR workflow skipped the full Linux and Windows Build jobs; an authorized collaborator must start Build for those under ci(build): require manual full builds and auto-test relinker for contr #2113.Checklist
main; overlap with fix(libkernel): report live mapping bounds in sceKernelVirtualQuery after partial unmap #2267 is disclosed, and its direct-mmapregression test is included here with original author attribution; coordination with its author is pending